<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/19
 * Time: 14:50
 */
$arr = range(1,5);
var_dump($arr);
array_walk($arr,function($item,$key){
    echo $key;
});


function my_walk($arr,$callback){
    foreach($arr as $k=>$v){
        $callback($v,$k);
    }
}
echo "<br>";
my_walk($arr,function($item,$key){
    echo $key;
});

?>

<script>
//    var arr = ['a','b','c'];
//    arr.forEach(function(){})
</script>
